package com.idroc.message.impl;

import org.apache.mina.common.ByteBuffer;

import com.idroc.message.AbstractMessage;
import com.idroc.message.Message;

public class HeartBeatMessage extends AbstractMessage {
	
	long heartBeat = -1;
	
	@Override
	protected void decodeMessage(ByteBuffer in) {
		heartBeat = in.getLong();
		
	}

	@Override
	protected void encodeMessage(ByteBuffer out) {

		out.putLong(heartBeat); 
	}

	public long getHeartBeat() {
		return heartBeat;
	}

	public void setHeartBeat(long heartBeat) {
		this.heartBeat = heartBeat;
	}

	@Override
	public String toString() {
		 
		return "heartBeat value:" + heartBeat;
	} 
}
